import request from '@/utils/request'

// 查询请假规则列表
export function listLeave(query) {
  return request({
    url: '/system/leave_category/list',
    method: 'get',
    params: query
  })
}

// 查询请假规则详细
export function getLeave(deptId) {
  return request({
    url: '/system/leave_category/' + deptId,
    method: 'get'
  })
}

// 新增请假规则
export function addLeave(data) {
  return request({
    url: '/system/leave_category',
    method: 'post',
    data: data
  })
}

// 修改请假规则
export function updateLeave(data) {
  return request({
    url: '/system/leave_category',
    method: 'put',
    data: data
  })
}

// 删除请假规则
export function delLeave(deptId) {
  return request({
    url: '/system/leave_category/' + deptId,
    method: 'delete'
  })
}

// 查询单人请假规则
export function listLeaveUSer(query) {
  return request({
    url: '/system/leave_category/user',
    method: 'get',
    params: query
  })
}
